package com.weiadmin.model.system;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 文章模型
 * @author: shizhongyu
 * @date: 2023年06月08日 15:23
 */
@Entity
@TableName( "cmf_post")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PostModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private String id;
    private String title;
    private String summary;
    private String post;
    private String cateId;

    @TableField(exist=false)
    private String categoryName;
    private int hits;
    private int status;
    private String thumb;
    private String videoUrl;
    //自动填充注解--新增时候更新
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //自动填充注解--新增和编辑时候都更新
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime  updateTime;
}
